// Copyright (C) ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
//
// $Id: test_resource.hpp 226 2008-09-12 17:56:02Z heavyzheng $
//

#ifndef ZZHENG_TEST_RESOURCE_HPP_20080717__
#define ZZHENG_TEST_RESOURCE_HPP_20080717__

#include <zzheng/test_config.hpp>
#include <exception>
#include <string>

namespace zzheng {
namespace test {

    class resource_error: public std::exception {

    public:

        explicit resource_error(): what_() {
            // Do nothing.
        }

        explicit resource_error(const char* what): what_(what) {
            // Do nothing.
        }

        virtual ~resource_error() throw() {
            // Do nothing.
        }

        virtual const char* what() const throw() {
            return what_.c_str();
        }

    private:

        std::string what_;

    }; // class resource_error

    ////////////////////////////////////////////////////////////////////////////////////////////////

    //! Returns the directory containing test resource files.
    std::string get_resource_dir();

    //! Returns the directory for test output files.
    std::string get_output_dir();

} // namespace zzheng::test
} // namespace zzheng

#endif // ZZHENG_TEST_RESOURCE_HPP_20080717__



